package com.yict.csms.system.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 用户数据权限组Entity
 * 
 * @author Patrick.Deng
 * 
 */
@Entity
@Table(name = "CSMS_USER_DATAPER")
public class UserDataper {

	@Id
	@Column(name = "CUWTID")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "csms_cuwt_seq")
	@SequenceGenerator(name = "csms_cuwt_seq", sequenceName = "SEQ_CSMS_CUWT", allocationSize = 1, initialValue = 1)
	private Long cuwtId;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CWTID", nullable = false)
	private Dataper dataper;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USERID", nullable = false)
	private User user;

	@Column(name = "CREATEDATE")
	private Date createDate;

	@Column(name = "UPDATEDATE")
	private Date updateDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATEPERSON")
	private User createPerson;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "UPDATEPERSON")
	private User updatePerson;

	public Long getCuwtId() {
		return cuwtId;
	}

	public void setCuwtId(Long cuwtId) {
		this.cuwtId = cuwtId;
	}

	public Dataper getDataper() {
		return dataper;
	}

	public void setDataper(Dataper dataper) {
		this.dataper = dataper;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public User getCreatePerson() {
		return createPerson;
	}

	public void setCreatePerson(User createPerson) {
		this.createPerson = createPerson;
	}

	public User getUpdatePerson() {
		return updatePerson;
	}

	public void setUpdatePerson(User updatePerson) {
		this.updatePerson = updatePerson;
	}
}
